package com.hudson.admin.util;


import com.hudson.admin.domain.Result;

/**
 * @Author: 渔小鲤
 * @DateTime: 2025/7/20 0:36
 **/
public class Results {

    public static Result<Void> success() {
        return new Result<>(200);
    }

    public static Result<Void>  success(String msg) {
        return new Result<>(200, msg);
    }

    public static <T> Result<T> success(T data) {
        return new Result<>(200, data);
    }

    public static <T>  Result<T>  success(String error,T data) {
        return new Result<>(200, error,data);
    }

    public static Result<Void>  error() {
        return new Result<>(500);
    }

    public static Result<Void>  error(String error) {
        return error(500, error);
    }

    public static <T>  Result<T>  error(String error,T data) {
        return new Result<>(500, error);
    }

    public static Result<Void>  error(int code, String error) {
        return new Result<>(code, error);
    }
}
